package com.yanqu.road.server.cmd.kowloon;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.kowloon.KowloonProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.kowloon.KowloonModule;
import com.yanqu.road.server.protocol.ClientProtocol;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.S_KOWLOON_OPERATE, desc = "操作")
public class KowloonChapterOperateCmd extends AbstractCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {

        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        KowloonProto.KowloonOperateReqMsg req = KowloonProto.KowloonOperateReqMsg.parseFrom(packet.getBytes());
        KowloonProto.KowloonOperateRespMsg.Builder respMsg = player.getModule(KowloonModule.class).operate(req);
        player.sendPacket(ClientProtocol.U_KOWLOON_OPERATE, respMsg);
    }

    @Override
    public void sendData(GamePlayer player) {

    }
}
